<include file="Public:header" />
<include file="Public:menu" menu_account="curr" />
<include file="Public:navibar" />
<include file="_sub_menu" usermanage="selected" />
<div id="main">
    <switch name="select">
    <case value="userFreeze">
        <h4>注册账户管理</h4>
        <hr class="dash">
        <form action="__URL__/userFreezes" method="post">
            选择冻结该账户的期限:
            <select name="deadline">
                <option value="days">三天</option>
                <option value="week">一周</option>
                <option value="month">一个月</option>
                <option value="year">一年</option>
            </select>
            <input type="hidden" name="backurl"  value="{{$Think.server.http_referer}}" /><br />
            <input type="hidden" name="user_id"  value="{{$user_id}}" /><br />
            <button class="btn btn_silver fbold" type="submit"><span>冻结</span></button>
        </form>
    </case>

    <case value="tweetsShow">
        <h4>{{$user.email}}({{$user.user_id}}) 的微博</h4>
        <hr class="dash">
        <form action="__URL__/tweetsDispose" method="post">
            <table class="list" width="100%">
                <thead>
                    <tr>
                        <th width="3%"><input name="checkbox" type="checkbox"  onClick="" /></th>
                        <th width="6%">ID</th>
                        <th width="6%">类别</th>
                        <th width="10%">学校</th>
                        <th wdith="10%">地点</th>
                        <th>内容</th>
                        <th width="8%">状态</th>
                        <th width="15%">发表时间</th>
                    </tr>
                </thead>
                <volist name="result" id="vo">
                    <tr>
                        <td><input name="id[]" type="checkbox" id="id[]" value="{{$vo.tweets_id}}" /></td>
                        <td>{{$vo.tweets_id}}</td>
                        <td><php>echo C("TWEETS_CATEGORY.".$vo["cate_id"])</php></td>
                    <td><a href="{{$Think.config.SITE_URL}}/{{$vo.school.school_id}}" target="_blank">{{$vo.school.school_name}}</a></td>
                    <td>{{$vo.location_name|default='未知'}}</td>
                    <td><a href="{{$Think.config.SITE_URL}}/tweets/r/tid/{{$vo.tweets_id}}" target="_blank">{{$vo.content}}</a></td>
                    <td>
                        <eq name="vo.status" value="0">
                        屏蔽
                    <else />
                    正常
                    </eq>
                    </td>
                    <td>{{$vo.create_time|date="Y-n-j H:i:s",###}}</td>
                    </tr>
                </volist>
                <tfoot>
                    <tr>
                        <td colspan="9">
                            <label><input type="radio" checked="checked" name="act" value="hide" /> 屏蔽</label>&nbsp;
                            <label><input type="radio" name="act" value="show" /> 显示</label>&nbsp;
                            <input type="submit" value="提交" />
                        </td>
                    </tr>
                </tfoot>
            </table>
        </form>
        <include file="Public:paging" />
    </case>

    <case value="commentShow">
        <h4>{{$user.email}}({{$user.user_id}}) 发评</h4>
        <hr class="dash">
        <form action="__URL__/commentDispose" method="post">
            <table class="list" width="100%">
                <thead>
                    <tr>
                        <th width="3%"><input name="checkbox" type="checkbox"  onClick="" /></th>
                        <th width="6%">评论ID</th>
                        <th width="6%">微博ID</th>
                        <th width="8%">昵称</th>
                        <th>内容</th>
                        <th width="8%">状态</th>
                        <th width="15%">发表时间</th>
                    </tr>
                </thead>
                <volist name="result" id="vo">
                    <tr>
                        <td><input name="id[]" type="checkbox" id="id[]" value="{{$vo.comment_id}}" /></td>
                        <td>{{$vo.comment_id}}</td>
                        <td><a href="{{$Think.config.SITE_URL}}/tweets/r/tid/{{$vo.tweets_id}}" target="_blank">{{$vo.tweets_id}}</a></td>
                        <td>{{$vo.nickname}}</td>
                        <td><a href="{{$Think.config.SITE_URL}}/tweets/r/tid/{{$vo.tweets_id}}" target="_blank">{{$vo.content}}</a></td>
                        <td>
                    <if condition="$vo.status eq 0">屏蔽
                        <else />正常
                    </if>
                    </td>
                    <td>{{$vo.create_time|date="Y-n-j H:i:s",###}}</td>
                    </tr>
                </volist>
                <tfoot>
                    <tr>
                        <td colspan="7">
                            <label><input type="radio" checked="checked" name="act" value="hide" /> 屏蔽</label> 
                            <label><input type="radio" name="act" value="show" /> 显示</label> 
                            <button class="btn btn_silver" type="submit"><span>提交</span></button>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </form>
        <include file="Public:paging" />
    </case>

    <case value="userEdit">
        <h4>用户资料修改</h4>
        <hr class="dash" />
        <form action="__URL__/userEdits" method="post">
            <table class="edit">
                <tr>
                    <td class="label">邮箱</td>
                    <td><input class="text" type="text" name="email" value="{{$user.email}}" /></td>
                </tr>
                <tr>
                    <td class="label">手机</td>
                    <td>
                        <input class="text" type="text" name="mobilephone" value="<neq name='user.mobilephone' value=''>{{$user.mobilephone}}</neq>" placeholder="未填写" />
                    </td>
                </tr>
                <tr>
                    <td class="label">密码</td>
                    <td><input class="text" type="password" name="password" value="" placeholder="不填写则保留原有密码" /></td>
                </tr>
                <tr>
                    <td class="label">学校</td>
                    <td><select name="school" class="select">
                            <option value="">选择学校..</option>
                            <volist name="school" id="list">
                                <option value="{{$list.school_id}}">{{$list.school_name}}</option>
                            </volist>
                        </select></td>
                </tr>
                <tr>
                    <td class="label">状态</td>
                    <td><label><input type="checkbox" name="status" class="checkbox" value="1" <eq name="user.status" value="1">checked</eq> /> 正常</label></td>
                </tr>
                <tr>
                    <td class="label"></td>
                    <td>
                        <input type="hidden" name="user_id" value="{{$user.user_id}}" />
                        <button class="btn btn_silver fbold" type="submit" onClick="if (confirm('是否确认提交？'))this.form.submit();return false;"><span>提交</span></button>
                    </td>
                </tr>
            </table>
        </form>
    </case>

    <default />
    <h4>用户账号管理</h4>
    <hr class="dash">
    <div class="console">
        <form name="search" method="get" action="__URL__/userManage" class="right">
            <select class="select" name="type">
                <option value="email">邮箱</option>
                <option value="school">学校</option>
                <option value="phone">手机</option>
            </select>&nbsp;
            <input class="text" type="text" name="keyword" value="{{$keyword}}"  />&nbsp;
            <button class="btn btn_silver fbold" type="submit"><span>搜索</span></button>
        </form>
    </div>
    <form action="__URL__/userDelete" method="post">
        <table class="list" width="100%">
            <thead>
                <tr>
                    <th width="3%"><input name="checkbox" type="checkbox"  onClick="" /></th>
                    <th width="5%">ID</th>
                    <th width="12%">学校</th>
                    <th>注册邮箱</th>
                    <th width="12%">手机</th>
                    <th width="6%">状态</th>
                    <th width="150">注册时间</th>
                    <th >操作</th>
                </tr>
            </thead>
            <volist name="user" id="vo">
                <tr>
                    <td><input name="id[]" type="checkbox" id="id[]" value="{{$vo.user_id}}" /></td>
                    <td>{{$vo.user_id}}</td>
                    <td>{{$vo.school_name}}</td>
                    <td>{{$vo.email}}</td>
                    <td>
                <if condition="$vo.mobilephone neq ''">
                    {{$vo.mobilephone}}
                    <else />未填写
                </if>
                </td>
                <td>
                <if condition="$vo.status eq 1">
                    有效
                    <else />
                    <abbr title="将于 {{$vo.deadline|date="Y-n-j H:i:s",###}} 解除冻结" class="red">冻结</abbr>
                </if>
                </td>
                <td>{{$vo.create_time|date="Y-n-j H:i:s",###}}</td>
                <td>
                <if condition="$super eq true">
                    <a href="__URL__/userDelete/user_id/{{$vo.user_id}}" onclick="return confirm('是否确认提交？')">删除</a>&nbsp;
                </if>
                <if condition="$super eq true">
                    <a href="__URL__/userEdit/user_id/{{$vo.user_id}}">编辑</a>&nbsp;
                </if>
                <if condition="$vo.status eq 1">
                    <a href="__URL__/userFreeze/user_id/{{$vo.user_id}}">冻结</a>&nbsp;
                    <else/>
                    <a href="__URL__/userThaw/user_id/{{$vo.user_id}}">解冻</a>&nbsp;
                </if>
                <a href="__URL__/tweetsShow/user_id/{{$vo.user_id}}">查看微博</a>&nbsp;
                <a href="__URL__/commentShow/user_id/{{$vo.user_id}}">查看评论</a>&nbsp;
                </td>
                </tr>
            </volist>
            <tfoot>
                <tr>
                    <td colspan="8">
                        <button type="submit" class="btn btn_silver" onclick="return confirm('是否确认提交？');"><span>删除所选账号</span></button>
                    </td>
                </tr>
            </tfoot>
        </table>
    </form>
    <include file="Public:paging" />
    </switch> 
</div>
<include file="Public:footer" />